<%@ page language="java" pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="ww" uri="webwork" %>

<div style="width:300px;height:400px">
	<ul id="headTree" class="ztree"></ul>
</div>
<script type="text/javascript">
var tree_org_setting = {
		data : {
			simpleData : {
				enable : true
			}
		},
		callback : {
			onAsyncSuccess : function(event, treeId, treeNode, msg){
			var treeObj = $.fn.zTree.getZTreeObj(treeId);
			if(treeObj.getSelectedNodes().length==0){
				var nodes = treeObj.getNodes();
				treeObj.selectNode(nodes[0]);
			}
		    }
		}

	};
var treeNodes=<ww:property value="result"/>;
var rf_tree  = null;
using(['tree'],function(){
   rf_tree =  $.fn.zTree.init($("#headTree"), tree_org_setting, treeNodes); 
})
</script>